# Author:  Simon Amor
# EMail:   simon@foobar.net
# WWW:     http://www.foobar.net/~simon/

# Makefile for netlib. Modify as appropriate.
# Tested on Linux and HPUX
# Requires ANSI compiler

# Directory tree for netlib
NETLIB = ..

# Linux
CFLAGS = -O2

# HPUX
#CFLAGS = -Ae

INCS = -I${NETLIB}/include
LIBS = -L${NETLIB}/lib

all:
	@echo "Current examples are:"
	@echo "-> chat     - a larger version of netex"
	@echo "-> socksrv  - tests NetSockServeProgram()"
	@echo "-> clean    - removes all .o"
	@echo ""
	@echo "Copy the appropriate files into your"
	@echo "directory along with this Makefile"

chat: chat.c
	cc ${CFLAGS} ${LIBS} ${INCS} -o chat chat.c -lnet
	strip chat

socksrv: socksrv.c ${NETLIB}/lib/libnet.a
	cc ${CFLAGS} ${LIBS} ${INCS} -o socksrv socksrv.c -lnet
	strip socksrv

netrun: netrun.c
	cc ${CFLAGS} ${LIBS} ${INCS} -o netrun netrun.c -lnet
	strip netrun

clean:
	rm -f *.o socksrv chat
